// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
const db=cloud.database();
exports.main = async (event, context) => {
  try {
    const fileIDs = [event.delImgId]
    await cloud.deleteFile({
      fileList: fileIDs,
    })
    return await db.collection("artcile").where({
      _id:event.delId
    }).remove()
  } catch (error) {
    console.log(error);
  }
}